<?php
exists_frame();
class data_class {
    public $user_data = array();
    public function __set($name,$value) {
        $this->user_data[$name] = $value;
    }
    public function __isset($name) {
        return isset($this->user_data[$name]);
    }
    public function __unset($name) {
        unset($this->user_data[$name]);
    }
    public function array2object(array $array) {
        foreach($array as $key =>$value) {
            if(is_array($value)) {
                $array[$key] = $this->array2object($value);
            }
        }
        return (object)$array;
    }
    public function __get($name) {
        if (array_key_exists($name, $this->user_data)) {
            return $this->user_data[$name];
        } else {
            return null;
        }
    }
}
